from app.model.base import *
from sqlalchemy import Index
from sqlalchemy.dialects.mysql import VARCHAR
from sqlalchemy import Column, String, TIMESTAMP, text, DECIMAL, Date
class User(Base):
    __tablename__ = 'user'
    __table_args__ = {'comment': 'user'}
    id = Column(BIGINT(20), primary_key=True, comment='用户id')
    name = Column(VARCHAR(255), nullable=False, server_default=text("'微信用户'"),comment='用户昵称')
    openid=Column(VARCHAR(255),nullable=False, comment='open_id')
    avatar=Column(VARCHAR(255), nullable=False,server_default=text("'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'"),comment='用户头像',)
    phone=Column(String(255), nullable=True, comment='手机号')
indexes=[Index('openix', User.openid), Index('mixix', User.is_deleted, User.openid)]


